home *** CD-ROM | disk | FTP | other *** search
- package Local.Game.Thing
- {
- import Local.Game.World.*;
- import Local.Game.World.Map.*;
- import Local.Game.World.Map.Cell.*;
- import Local.Math.*;
- import STC9.System.*;
- import flash.display.*;
- import flash.events.*;
- import flash.geom.*;
-
- public class CWeaponGunApache extends CWeapon
- {
-
- private static var mSoundIndex:* = 0;
-
- public static var _Upgrades:Array = [{
- "mName":"",
- "mAmmo":INFINATEAMMO,
- "mAutoFire":true,
- "mFireRate":1,
- "mDamage":10,
- "mRange":700
- }];
-
-
- public function CWeaponGunApache()
- {
- super();
- mUpgrade = 0;
- mType = "gunapache";
- Process = Process_Normal;
- AddAnimation("stand",Apache_MainGun,"AddSprite_Black");
- AddSound("fire_0",Apache_Shot_1);
- AddSound("fire_1",Apache_Shot_2);
- AddSound("fire_2",Apache_Shot_3);
- AddSound("fire_3",Apache_Shot_4);
- }
-
- override public function Fire() : void
- {
- var _loc1_:CShot = null;
- AddThing(_loc1_ = new CShotBullet(GetShotPosition(),GetShotDelta(),100 + Math.random() * 80,mCurrentTarget));
- IncrementFired();
- if(mParent.mDrawn)
- {
- AddThing(new CEffectMuzzleFlash(MuzzleFlash_M16,_loc1_.mPosition.Clone(),_loc1_.mDelta));
- }
- var _loc2_:*;
- var _loc3_:* = Number((_loc2_ = §§findproperty(mSoundIndex)).mSoundIndex) + 1;
- §§push(§§findproperty(PlaySound));
- §§push("fire_");
- §§push(Number((_loc2_ = §§findproperty(mSoundIndex)).mSoundIndex));
- if(true)
- {
- _loc2_.mSoundIndex = _loc3_;
- }
- if(true)
- {
- §§push(§§pop() % 4);
- }
- §§pop().PlaySound(§§pop() + §§pop());
- }
-
- public function GetShotDelta() : CPosition
- {
- return CPosition.SUBTRACT(mCurrentTarget.mCollide.mMid,mPosition);
- }
-
- public function GetShotPosition() : CPosition
- {
- var _loc1_:Point = null;
- _loc1_ = mAngle.mMatrix.transformPoint(mSprite.mObjects["shot"].mPosition);
- return new CPosition(_loc1_.x + mPosition.x,_loc1_.y + mPosition.y);
- }
-
- override public function get mWeaponName() : String
- {
- return "minigun";
- }
-
- override public function Draw() : void
- {
- super.Draw();
- DrawSprite(GetOrientationMatrix());
- }
-
- public function Process_Normal() : void
- {
- if(mCurrentTarget)
- {
- mAngle.mAngleRAD = CPosition.SUBTRACT(mCurrentTarget.mCollide.mMid,mPosition).mAngleRAD;
- }
- WeaponUpdate();
- Process_Children();
- }
-
- override public function get mUpgrades() : Array
- {
- return _Upgrades;
- }
- }
- }
-